//
//  TGDockItem.m
//  GroupBuy
//
//  Created by wwj on 15/10/30.
//  Copyright © 2015年 wwj. All rights reserved.
//

#import "TGDockItem.h"

@interface TGDockItem ()

@end

@implementation TGDockItem

- (instancetype)initWithCoder:(NSCoder *)coder{
    self = [super initWithCoder:coder];
    if (self) {
        [self initView];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
    }
    return self;
}

-(void)setFrame:(CGRect)frame{
    frame.size = CGSizeMake(kDockW, kDockH);
    [super setFrame:frame];
}

-(void)setHighlighted:(BOOL)highlighted{}

- (void)initView{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kDockW, 2)];
    [self addSubview:imageView];
    imageView.image = [UIImage imageNamed:@"separator_tabbar_item"];
    imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
    self.divider = imageView;
    self.imageView.contentMode =  UIViewContentModeCenter;
}

-(void)setIcon:(NSString *)icon{
    _icon = icon;
    [self setImage:[UIImage imageNamed:icon] forState:UIControlStateNormal];
}

-(void)setSelectIcon:(NSString *)selectIcon{
    _selectIcon = selectIcon;
    [self setImage:[UIImage imageNamed:selectIcon] forState:UIControlStateDisabled];
}

-(void)setIcon:(NSString *)icon selectIcon:(NSString *)selectIcon{
    self.icon = icon;
    self.selectIcon = selectIcon;
}

@end
